package com.shuyun.concurrent;

import java.util.Random;
import java.util.concurrent.ForkJoinPool;

/**
 * @description:
 * @author: shuai.chen@shuyun.com
 * @date: 2021/9/10 1:15 下午
 */
public class ForkjoinDemo {

    static Random random = new Random(0);

    static long random() {
        return random.nextInt(10000);
    }

    public static void main(String[] args) {
        // 创建2000个随机数组成的数组
        long[] array = new long[2000];
        long expectedSum = 0;
        for (int i = 0; i < array.length; i++) {
            array[i] = random();
            expectedSum += array[i];
        }
        System.out.println("Expected sum: " + expectedSum);
    }



}
